package demo;

import javax.crypto.spec.PSource;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 刘远望
 * Date: 2025-03-22
 * Time: 8:44
 */
//抽象类被abstract修饰
abstract class Shape {
    public String name;
    //抽象方法，不用给出实例
    abstract void draw();

    public Shape(String name) {
        this.name = name;
    }
}
class Cycle extends Shape{
    public Cycle(String name) {
        super(name);
    }

    @Override
    void draw() {
        System.out.println("画一个圆");
    }
}
abstract class Rect extends Shape{
    public Rect(String name) {
        super(name);
    }
    //抽象子类
}
public class Test {
    public static void main(String[] args) {

    }
}

